package com.bps.zzant.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class PrintingController {
	
	private static final Logger logger = LoggerFactory.getLogger(PrintingController.class);
	
	@RequestMapping(value = "/printorder", method = RequestMethod.GET)
	public ModelAndView printOrderPdf(	HttpServletRequest request,	HttpServletResponse response)throws Exception{

		String orderID = request.getParameter("orderID");
		String orderStatus = request.getParameter("orderStatus");
		logger.info("----------- in the ReportController -----------------:"+orderID + "|" + orderStatus);
		
		Map map = new HashMap();
		map.put("format", "pdf");
		map.put("order_id", orderID);
		// map.put("dateSource", "dataSource");
		// if("PENDING".equalsIgnoreCase(orderStatus)){
			// return new ModelAndView("quotationReportPdf", map);
		// }else {
			return new ModelAndView("orderPdfView", map);
		// }
		}

}
